package deepbitview

/**
 * simple controller to create your wallet account
 */
class MtgoxController {

    static allowedMethods = [save: "POST", update: "POST", delete: "POST"]

    def create = {
        def mtgoxInstance = new Mtgox()
        mtgoxInstance.properties = params
        return [mtgoxInstance: mtgoxInstance]
    }

    def save = {
        def mtgoxInstance = new Mtgox(params)
        if (mtgoxInstance.save(flush: true)) {
            flash.message = "${message(code: 'default.created.message', args: [message(code: 'mtgox.label', default: 'Mtgox'), mtgoxInstance.id])}"
            redirect(controller: "overview", action: "index")
        }
        else {
            render(view: "create", model: [mtgoxInstance: mtgoxInstance])
        }
    }

}
